import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout'
Vue.use(VueRouter)

const routes = [
  {
    path:'/login',
    component: () => import('@/views/Login/index'),
    hidden: true
  },
  {
    path:'/',
    component: Layout,
    redirect:'/dashboard',
    children:[
      {
        path:'/',
        name:'Dashboard',
        component: () => import('@/views/Dashboard/index'),
        mate:{title:'首页'}
      }
    ]
  },
  {
    path:'/order',
    component: Layout,
    children:[
      {
        path:'',
        name:'Order',
        component: () => import('@/views/Order/index'),
        mate:{title:'订单'}
      }
    ]
  },
  {
    path:'/commodity',
    component: Layout,
    children:[
      {
        path:'',
        name:'Commodity',
        component: () => import('@/views/Commodity/index'),
        mate:{title:'商品'}
      }
    ]
  },
  {
    path:'/financing',
    component: Layout,
    children:[
      {
        path:'',
        name:'Financing',
        component: () => import('@/views/Financing/index'),
        mate:{title:'财务'}
      }
    ]
  },
  {
    path:'/information',
    component: Layout,
    children:[
      {
        path:'',
        name:'Information',
        component: () => import('@/views/Information/index'),
        mate:{title:'数据'}
      }
    ]
  },
  {
    path:'/management',
    component: Layout,
    children:[
      {
        path:'',
        name:'Management',
        component: () => import('@/views/Management/index'),
        mate:{title:'操作员'}
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
